/*
 * com_cute4j_nunit_NativeTest.cpp  0.4.0 / Nov 14, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#include "com_cute4j_nunit_NativeTest.h"

#ifdef CUTE4J_TEST

/*
 * Native implementation for: com.cute4j.nunit.NativeTest
 */

#include "NativeTestRegistry.h"

JNIEXPORT void JNICALL
Java_com_cute4j_nunit_NativeTest__1setUp
  (JNIEnv *env, jobject, jlong testCase)
{
  nativeTest->setUp(env);
}

JNIEXPORT void JNICALL
Java_com_cute4j_nunit_NativeTest__1tearDown
  (JNIEnv *env, jobject, jlong testCase)
{
  nativeTest->tearDown(env);
}

JNIEXPORT jboolean JNICALL
Java_com_cute4j_nunit_NativeTest__1invokeMethod
  (JNIEnv *env, jobject obj, jlong testCase, jstring methodName)
{
  return nativeTest->invokeMethod(env, obj, methodName);
}

JNIEXPORT jobjectArray JNICALL
Java_com_cute4j_nunit_NativeTest__1getTestModules
  (JNIEnv *env, jclass)
{
  return NativeTestRegistry::getTestModules(env);
}

JNIEXPORT jobjectArray JNICALL
Java_com_cute4j_nunit_NativeTest__1getTestCases
  (JNIEnv *env, jclass, jstring testModule)
{
  return NativeTestRegistry::getTestCases(env, testModule);
}

JNIEXPORT jlong JNICALL
Java_com_cute4j_nunit_NativeTest__1createTestCase
  (JNIEnv *env, jclass, jstring testModule, jstring testCase)
{
  return NativeTestRegistry::createTestCase(env, testModule, testCase);
}

JNIEXPORT jobjectArray JNICALL
Java_com_cute4j_nunit_NativeTest__1getTests
  (JNIEnv *env, jclass, jlong testCase)
{
  return nativeTest->getTestMethods(env);
}

JNIEXPORT void JNICALL
Java_com_cute4j_nunit_NativeTest__1initialize
  (JNIEnv *env, jclass cls)
{
  NativeTest::initialize(env, cls);
}

#endif // CUTE4J_TEST

